package interfaceComUsuario;

import java.io.OutputStream;
import java.io.PrintStream;

import javax.swing.JTextArea;

public class TextAreaPrintStream extends PrintStream
{
	private JTextArea textArea;
	
	public TextAreaPrintStream(JTextArea textArea, OutputStream out)
	{
		super(out);
		this.textArea = textArea;
	}

	/* (non-Javadoc)
	 * @see java.io.PrintStream#print(java.lang.String)
	 */
	@Override
	public void print(String s)
	{
		textArea.append(s);
	}

	/* (non-Javadoc)
	 * @see java.io.PrintStream#println(java.lang.String)
	 */
	@Override
	public void println(String s)
	{
		textArea.append(s+"\n");
	}
	

}
